package com.jbm.jsm.iface;

import com.jbm.core.iface.IAcross;
import org.hibernate.annotations.*;
import org.hibernate.annotations.Cache;

import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;

/**
 * Created by Administrator on 2017/9/26.
 */
@Entity
@Table(name = "jinmi_log", schema = "", catalog = "jsm")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class JinmiLogEntity extends IAcross
{
    public List<JinmiLogEntity> logList;
    public String startDate;
    public String endDate;
    String consumeTypeCn;
    private int id;
    private Integer userId;
    private Integer mainId;
    private String type;
    private BigDecimal amount;
    private String memo;
    private Integer consumeType;
    private Integer status;
    private Integer createId;
    private Timestamp createDate;
    private BigDecimal moneyamount;
    private BigDecimal serviceCharge;
    private BigDecimal blance;
   // private BigDecimal jl_blance;
    private BigDecimal jlBlance;
    private BigDecimal jlAmount;

    public JinmiLogEntity()
    {
        super();
    }

    public JinmiLogEntity(IAcross ia)
    {
        super(ia);
    }

    @Id
    @Column(name = "id")
    @GeneratedValue
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id")
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "main_id")
    public Integer getMainId() {
        return mainId;
    }

    public void setMainId(Integer mainId) {
        this.mainId = mainId;
    }

    @Basic
    @Column(name = "type")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @Column(name = "amount")
    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    @Basic
    @Column(name = "memo")
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Basic
    @Column(name = "consume_type")
    public Integer getConsumeType() {
        return consumeType;
    }

    public void setConsumeType(Integer consumeType) {
        this.consumeType = consumeType;
    }

    @Basic
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "create_id")
    public Integer getCreateId() {
        return createId;
    }

    public void setCreateId(Integer createId) {
        this.createId = createId;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "moneyamount")
    public BigDecimal getMoneyamount() {
        return moneyamount;
    }

    public void setMoneyamount(BigDecimal moneyamount) {
        this.moneyamount = moneyamount;
    }

    @Basic
    @Column(name = "service_charge")
    public BigDecimal getServiceCharge() {
        return serviceCharge;
    }

    public void setServiceCharge(BigDecimal serviceCharge) {
        this.serviceCharge = serviceCharge;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        JinmiLogEntity that = (JinmiLogEntity) o;

        if (id != that.id) return false;
        if (amount != null ? !amount.equals(that.amount) : that.amount != null) return false;
        if (consumeType != null ? !consumeType.equals(that.consumeType) : that.consumeType != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (createId != null ? !createId.equals(that.createId) : that.createId != null) return false;
        if (mainId != null ? !mainId.equals(that.mainId) : that.mainId != null) return false;
        if (memo != null ? !memo.equals(that.memo) : that.memo != null) return false;
        if (moneyamount != null ? !moneyamount.equals(that.moneyamount) : that.moneyamount != null) return false;
        if (serviceCharge != null ? !serviceCharge.equals(that.serviceCharge) : that.serviceCharge != null)
            return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (mainId != null ? mainId.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (amount != null ? amount.hashCode() : 0);
        result = 31 * result + (memo != null ? memo.hashCode() : 0);
        result = 31 * result + (consumeType != null ? consumeType.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (createId != null ? createId.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + (moneyamount != null ? moneyamount.hashCode() : 0);
        result = 31 * result + (serviceCharge != null ? serviceCharge.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "blance")
    public BigDecimal getBlance() {
        return blance;
    }

    public void setBlance(BigDecimal blance) {
        this.blance = blance;
    }

//    @Basic
//    @Column(name = "jl_blance")
//    public BigDecimal getJl_blance() {
//        return jl_blance;
//    }
//
//    public void setJl_blance(BigDecimal jl_blance) {
//        this.jl_blance = jl_blance;
//    }

    @Transient
    public String getStartDate() {
        return startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    @Transient
    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    @Transient
    @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
    public List<JinmiLogEntity> getLogList() {
        return logList;
    }

    public void setLogList(List<JinmiLogEntity> logList) {
        this.logList = logList;
    }

    @Transient
    public String getConsumeTypeCn() {
        return consumeTypeCn;
    }

    public void setConsumeTypeCn(String consumeTypeCn) {
        this.consumeTypeCn = consumeTypeCn;
    }

    @Basic
    @Column(name = "jl_blance")
    public BigDecimal getJlBlance() {
        return jlBlance;
    }

    public void setJlBlance(BigDecimal jlBlance) {
        this.jlBlance = jlBlance;
    }

    @Basic
    @Column(name = "jl_amount")
    public BigDecimal getJlAmount() {
        return jlAmount;
    }

    public void setJlAmount(BigDecimal jlAmount) {
        this.jlAmount = jlAmount;
    }
}
